package com.yyh.mapper;

import com.yyh.entity.Roles;
import com.yyh.entity.Userroles;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yangyueheng
 * @since 2020-06-02
 */
public interface UserrolesMapper extends BaseMapper<Userroles> {
	@Select("select * from roles where id in(select role_id from userroles where user_id = #{uid})")
	List<Roles> getRolesByUsersId(Integer uid);
	
	boolean removeRolesByUserId(@Param("uid") Integer userId, @Param("arr") String[] arr);
	
	boolean addRolesByUsersId();
}
